#ifndef GUIMAINCASE_H
#define GUIMAINCASE_H
#include "config.h"
#include "GhostFunction.h"
#include "firstmain.h"
#include "playquery.h"
#include "appsetting.h"

#include "importhomes.h"

class WorkPanel : public QWorkspace
{
    Q_OBJECT
//
public:
 WorkPanel( QWidget * parent = 0 );
protected:
    void paintEvent(QPaintEvent *e);
private:
signals:
public slots:
};



class GuiMainCase : public FirstMain
{
    Q_OBJECT
    Q_CLASSINFO("author", "Peter Hohl")
    Q_CLASSINFO("url", "http://www.crosskern.com/")

public:
    GuiMainCase(QWidget *parent = 0);
    ~GuiMainCase();

private:
    void init();
    int runnertime;
    
    void LoadWorkSpace();
    DB_Manager *line;
    AppSetting *settaggio;
    bool online;
    QToolBar *XtoolBar;
    
    
    WorkPanel *workspace;
    QList<EditItem *> case_aperte;
    Ui::GuiMainCaseClass ui;
    ImportHomes *remotegetter;
    QPixmap logosmall;
    /* per rigenera totale */
    QSqlQueryModel *rig_model;
    QMap<int,HtmlGenerator*> run_current;
    QMap<int,QString> run_error;
    int sum_job;
    int NEXT;
    bool reg_continue;
    QProgressDialog *progress;
    protected:
    void closeEvent( QCloseEvent* e );
signals:
private slots:
    void Init_Page_Row();
public slots:
    void LoadingAll(); /* loading web tree visible */
    void on_Regioni_triggered();
    void on_Attributi_triggered();
    void on_CloseAll_triggered();
    void on_NuovaCasa_triggered();
    void Apri_Casa( uint id );
    void EC_Remove( uint id );
    void on_Cascata_triggered();
    void on_Tile_triggered();
    void ActiveOCase( QModelIndex index );
    void Reload_Menu();
    void on_actionAbout_triggered() ;
    void on_TableEditor_triggered();
    void on_SettaggioDbs_triggered();
    void on_actionAggiorna_case_triggered();
    void on_actionAggiorna_cambio_euro_triggered();
    void reload();
    void on_pubblica_all_triggered();

    void SwapMenu();
    void Sincroclose();
    void on_CategorieWeb_triggered();
    void msg( const QString txt  );
    
    void ExitChainer();
    void Regenerate_Webs();
    void Page_Ming( bool succ , int ids );
    void childFinished( uint i );
    void childerror( uint i );
    void handleMessage(const QString& message);
    
};








#endif // GUIMAINCASE_H
